﻿using System;
using System.Collections.Generic;
using System.Text;
using Gammar.Digger.DALFactory;
using Gammar.Digger.Entity;
using Gammar.Digger.SystemFramework;
using Gammar.Digger.IDAL;
namespace Gammar.Digger.BLL
{
    public class StatusManagement
    {

        public static SortList<System_statusEntity> GetSystemStatus(string whereCondition)
        {
            try
            {
                ISystem_status sys = DataAccess.CreateSystem_status();
                return sys.GetList(whereCondition);
            }
            catch (Exception ex)
            {
                LogUtility.WriteErrLog(ex.Message);
                return null;
            }
           
        }

        public static SortList<plugin_run_statusEntity> GetPluginStatus(string whereCondition)
        {
            try
            {
                Iplugin_run_status run = DataAccess.Createplugin_run_status();
                return run.GetList(whereCondition);
            }
            catch (Exception ex)
            {
                LogUtility.WriteErrLog(ex.Message);
                return null;
            }
        }

        public static SortList<plugin_run_logEntity> GetPluginLogs(int statusId)
        {
            try
            {
                Iplugin_run_log run = DataAccess.Createplugin_run_log();
                return run.GetList("status_id=" + statusId.ToString());
            }
            catch (Exception ex)
            {
                LogUtility.WriteErrLog(ex.Message);
                return null;
            }
        }

       


    }
}
